Warning: Declaration of AMW_Related_Sub_Items_Walker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /home/bu1hme7g/public_html/sleepandgo.es/wp-content/plugins/advanced-menu-widget/class-advanced-menu-walker.php on line 332
// source --> http://www.sleepandgo.es/wp-content/themes/business-world/inc/js/responsive.js?ver=1.1.26
var wdwt_window_cur_size = 'screen';
jQuery('document').ready(function ()
{
//var previus_view=document.getElementById('top_posts_web').innerHTML;
//screenSize=jQuery(".container").width();
jQuery('.cont_vat_tab ul.content > li').filter(function ()
{
return jQuery(this).css("display") != 'none'
}).addClass('active');
jQuery('#wd-categories-tabs > .tabs > li').eq(0).addClass('active');
sliderHeight = parseInt(jQuery("#slider-wrapper").height());
sliderWidth = parseInt(jQuery("#slider-wrapper").width());
sliderIndex = sliderHeight / sliderWidth;
if (matchMedia('only screen and (max-width : 767px)').matches) {
phone();
}
else
if (matchMedia('only screen and (min-width: 768px) and (max-width: 1024px)').matches) {
tablet();
}
else {
checkMedia();
}
add_top_posts_click();
var window_width = jQuery(window).width();
jQuery(window).resize(function ()
{
checkMedia();
});
function checkMedia()
{
//###############################SCREEN
if (matchMedia('only screen and (min-width: 1025px)').matches) {
screen();
}
//###############################TABLET
if (matchMedia('only screen and (min-width: 768px) and (max-width: 1024px)').matches) {
tablet();
}
//################################PHONE
if (matchMedia('only screen and (max-width : 767px)').matches) {
phone(false);
}
}
function screen()
{
slider.install('top-posts-list');
jQuery("#blog,.blog,#top-posts .container,#header-top + .container").removeAttr("style");
jQuery('.container>#blog').before(jQuery('#sidebar1'));
jQuery("#header .phone-menu-block").removeClass("container");
sHeight = sliderIndex * parseInt(jQuery("#slider-wrapper").width());
sliderSize(sHeight);
jQuery(".parallax-window").css("padding", "");
if (wdwt_window_cur_size == 'phone') {
jQuery("#header").find("#menu-button-block").remove();
jQuery("#top-nav").css({"display": "block"});
jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove();
jQuery("#header-top .container").append(jQuery("#social"));
jQuery("#header-middle").prepend(jQuery("#logo"));
jQuery("aside .sidebar-container .widget-area").removeClass("clear");
jQuery('#content').after(jQuery('#sidebar1'));
}
if (wdwt_window_cur_size == 'tablet') {
jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove();
}
if (wdwt_window_cur_size == 'phone' || wdwt_window_cur_size == 'tablet') {
jQuery("#top-posts-list> li .top-post-caption").removeClass('open');
jQuery("#top-posts-list> li .top-post-caption").removeClass('top_posts_hovered_caption');
}
jQuery('.cont_vat_tab ul.content').height(jQuery('.cont_vat_tab ul.content > li.active').filter(function ()
{
return jQuery(this).css("display") != "none"
}).height())
inserting_div_float_problem(jQuery('#sidebar-footer'));
resize_iframes();
wdwt_window_cur_size = 'screen';
}
function tablet()
{
slider.unbind();
var str = (jQuery(window).width() / 1024);
jQuery(".parallax-window").css("padding", business_world_options.wdwt_pinned_padding * str + "px 0");
jQuery('#blog').after(jQuery('#sidebar1'));
jQuery('.container>#content').after(jQuery('#content>#sidebar1'));
jQuery("#header .phone-menu-block").removeClass("container");
if (wdwt_window_cur_size == 'phone') {
jQuery("#header").find("#menu-button-block").remove();
jQuery("#top-nav").css({"display": "block"});
jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove();
jQuery("#header-top .container").append(jQuery("#social"));
jQuery("#header-middle").prepend(jQuery("#logo"));
jQuery("aside .sidebar-container .widget-area").removeClass("clear");
jQuery(".top-posts-block").width("100%");
}
jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove();
jQuery("#top-nav > div > ul li:has(> ul),#top-nav > div > div > ul li:has(> ul)").each(function ()
{
var strtext = jQuery(this).children("a").html();
var strhref = jQuery(this).children("a").attr("href");
var strlink = '' + strtext + '';
jQuery(this).children("ul").prepend('' + strlink + '');
});
jQuery('.cont_vat_tab ul.content').height(jQuery('.cont_vat_tab ul.content > li.active').filter(function ()
{
return jQuery(this).css("display") != "none"
}).height())
sHeight = sliderIndex * parseInt(jQuery("#slider-wrapper").width());
sliderSize(sHeight);
resize_iframes();
wdwt_window_cur_size = 'tablet';
}
function phone(full)
{
slider.unbind();
var str = (jQuery(window).width() / 1024);
jQuery(".parallax-window").css("padding", business_world_options.wdwt_pinned_padding * str + "px 0");
jQuery("#header .phone-menu-block").addClass("container");
jQuery('.container>#content').after(jQuery('.container>#sidebar1'));
jQuery('#blog').after(jQuery('#sidebar1'));
jQuery(".featured-content .single-post-text").after(jQuery(".featured-content img"));
sHeight = sliderIndex * parseInt(jQuery("#slider-wrapper").width());
sliderSize(sHeight);
//### PHONE UNIQUE STYLES
// jQuery(".cont_horizontal_tab").after(jQuery(".phone #tabs_div"))
jQuery("#top-nav > div > ul li.addedli,#top-nav > div > div > ul li.addedli").remove();
jQuery("#top-nav > div > ul li:has(> ul),#top-nav > div > div > ul li:has(> ul)").each(function ()
{
var strtext = jQuery(this).children("a").html();
var strhref = jQuery(this).children("a").attr("href");
var strlink = '' + strtext + '';
jQuery(this).children("ul").prepend('' + strlink + '');
});
if (wdwt_window_cur_size != 'phone') {
jQuery("#header-top .container").prepend(jQuery("#logo"));
}
for (var i = 0; i < jQuery("aside .sidebar-container .widget-area").length; i++) {
if (i % 2 == 0) {
jQuery("aside .sidebar-container .widget-area").eq(i).addClass("clear");
}
}
jQuery("#header").find("#menu-button-block").remove();
jQuery("#header .phone-menu-block").append('');
if (!jQuery("#top-nav").hasClass("open")) {
jQuery("#top-nav").css({"display": "none"})
}
;
jQuery('.cont_vat_tab ul.content').height(jQuery('.cont_vat_tab ul.content > li.active').filter(function ()
{
return jQuery(this).css("display") != "none"
}).height())
wdwt_window_cur_size = 'phone';
resize_iframes();
}
function add_top_posts_click()
{
jQuery("#top-posts-list> li").click(function ()
{
if (wdwt_window_cur_size == 'tablet' || wdwt_window_cur_size == 'phone') {
jQuery("#top-posts-list> li").find(".top-post-caption").removeClass("open").removeClass("top_posts_hovered_caption")
if (!jQuery(this).find(".top-post-caption").hasClass("open")) {
jQuery(this).find(".top-post-caption").addClass("open");
jQuery(this).find(".top-post-caption").addClass("top_posts_hovered_caption");
}
else {
jQuery(this).find(".top-post-caption").removeClass("open");
jQuery(this).find(".top-post-caption").removeClass("top_posts_hovered_caption");
}
}
}
);
}
function resize_iframes()
{
var allVideos = jQuery("iframe, object, embed");
allVideos.each(function ()
{
var el = jQuery(this);
fluidParent = el.parent();
var newWidth = fluidParent.width();
if (newWidth >= el.attr('data-origWidth')) {
newWidth = el.attr('data-origWidth');
}
el.width(newWidth)
.height(newWidth * el.attr('data-aspectRatio'));
});
}
function sliderSize(sHeight)
{
jQuery("#slider-wrapper").css('height', sHeight);
}
function inserting_div_float_problem(main_div)
{
jQuery(main_div).children('.clear:not(:last-child)').remove();
var iner_elements = jQuery(main_div).children();
var main_width = jQuery(main_div).width();
var summary_width = 0;
for (i = 0; i < iner_elements.length; i++) {
summary_width = summary_width + jQuery(iner_elements[i]).outerWidth();
if (summary_width > main_width) {
jQuery(iner_elements[i]).before('')
summary_width = jQuery(iner_elements[i]).outerWidth();
}
}
}
})
;
// source --> http://www.sleepandgo.es/wp-content/themes/business-world/inc/js/javascript.js?ver=1.1.26
var slider = {
element_id: 'top-posts-list',
hovered_width: 150,
standart_with: 150,
unhovered_width: 150,
childeren_count: 4,
animation_duration: 200,
install: function (ul_element_id)
{
this.element_id = ul_element_id;
this.generete_widths(this.element_id);
this.resize();
this.initial_start_widths();
this.set_widths(this.element_id);
},
generete_widths: function (ul_element_id)
{
this.main_ul_width = jQuery('#' + ul_element_id).parent().parent().width();
this.childeren_count = jQuery('#' + ul_element_id).children().length;
this.hovered_width = this.main_ul_width / 2;
if (this.childeren_count == 1) {
this.hovered_width = this.main_ul_width;
}
/*
if(this.childeren_count < 3){
this.childeren_count = 3;
}
*/
this.standart_with = this.main_ul_width / this.childeren_count;
this.unhovered_width = (this.hovered_width) / (this.childeren_count - 1);
},
initial_start_widths: function ()
{
this.generete_widths(this.element_id);
jQuery('#' + this.element_id).width(this.main_ul_width * this.childeren_count);
jQuery('#' + this.element_id).children().width(this.standart_with);
},
set_widths: function (ul_element_id)
{
locale_this = this;
jQuery('#' + ul_element_id).children().hover(gag_hover = function ()
{
jQuery(this).stop().animate({width: locale_this.hovered_width}, locale_this.animation_duration);
jQuery(this).parent().children().not(this).stop().animate({width: locale_this.unhovered_width}, locale_this.animation_duration)
}, gag_unhover = function ()
{
jQuery(this).parent().children().stop().animate({width: locale_this.standart_with}, locale_this.animation_duration);
}
);
},
resize: function ()
{
local_this = this;
jQuery(window).resize(gag = function ()
{
local_this.initial_start_widths();
});
},
unbind: function ()
{
jQuery(window).unbind('resize', gag);
jQuery('#' + this.element_id).children().unbind('hover', gag_hover, gag_unhover)
}
}
slider.install('top-posts-list');
jQuery(document).ready(function ()
{
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
jQuery('.pinned_post_bg').css('background-attachment', 'scroll');
}
if (!jQuery('header').find('.bwg_slideshow_image_wrap').length && !jQuery('header').find('.parallax_header').length) {
jQuery('#blog h2.page-header').css({"position": "static", "padding": "0"});
jQuery('aside').css("margin-top", "15px");
jQuery('.home aside').css("margin-top", "60px");
}
if (jQuery('.page-header').html() == "")
jQuery('.page-header').addClass("notitle");
jQuery('#top-nav li:has(> ul)').addClass('haschild');
jQuery("#top-nav > div > ul li,#top-nav > div > div > ul li").hover(function ()
{
jQuery(this).parent("ul").children().removeClass("active");
jQuery(this).addClass("active");
jQuery(this).find(">ul").slideDown("fast");
/*horizontall scroll prevention*/
{
if (jQuery(this).find('ul').eq(0).length && !matchMedia('only screen and (max-width : 767px)').matches) {
open_submenu = jQuery(this).find('ul').eq(0);
sub_left = open_submenu.offset().left;
sub_width = open_submenu.width();
current_left = open_submenu.position().left;
parent_class = function (classname)
{
return open_submenu.parent().parent().hasClass(classname);
}
parent_mainmenu = function ()
{
return !open_submenu.parent().parent().parent().hasClass('haschild');
}
if (/*parent_left +*/ sub_left + sub_width > jQuery(window).width() - 24) {
if (parent_class('sub_d_shift')) {
/*parent also shifted*/
open_submenu.addClass('sub_shift');
open_submenu.css({left: current_left + jQuery(window).width() - 24 - sub_left - sub_width});
}
else {
if (parent_mainmenu()) { // main menu
open_submenu.addClass('sub_shift');
open_submenu.css({left: current_left + jQuery(window).width() - 24 - sub_left - sub_width});
}
else {
parent_w = open_submenu.parent().parent().width();
open_submenu.addClass('sub_d_shift');
open_submenu.css({left: -sub_width});
}
}
}
}
}
}, function ()
{
if (matchMedia('screen and (max-width : 767px)').matches) {
/*phone(false);
*/
}
jQuery(this).parent("ul").children().removeClass("active");
jQuery(this).find(">ul").slideUp(100);
jQuery(".opensub").removeClass("opensub");
});
jQuery(window).resize(function ()
{
wdwt_reset_submenus();
});
jQuery("#top-nav > div > ul li.haschild > a,#top-nav > div > div > ul li.haschild > a").click(function ()
{
if (matchMedia('screen and (max-width : 767px)').matches || matchMedia('screen and (min-width: 768px) and (max-width: 1024px)').matches) {
if (jQuery(this).parent().hasClass("open")) {
jQuery(this).parent().parent().find(".haschild ul").slideUp(100);
jQuery(this).parent().removeClass("open");
return false;
}
jQuery(this).parent().parent().find(".haschild ul").slideUp(100);
jQuery(this).parent().parent().find(".haschild").removeClass("open");
jQuery(this).next("ul").slideDown("fast");
jQuery(this).parent().addClass("open");
return false;
}
});
jQuery("#header .phone-menu-block").on("click", "#menu-button-block", function ()
{
if (jQuery("#top-nav").hasClass("open")) {
jQuery("#header #top-nav").slideUp("fast");
jQuery("#top-nav").removeClass("open");
}
else {
jQuery("#header #top-nav").slideDown("slow");
jQuery("#top-nav").addClass("open");
}
});
/*##############CATEGORIES TABS####################*/
jQuery("#wd-horizontal-tabs ul.tabs").width(jQuery("#wd-horizontal-tabs ul.tabs li").length * jQuery("#wd-horizontal-tabs ul.tabs li").width());
jQuery("#tabs_content").width(jQuery("#tabs_div").width() - 32);
if (jQuery("#wd-horizontal-tabs ul.tabs").width() > jQuery("#tabs_content").width()) {
var visibleCount = jQuery("#tabs_content").width() / jQuery("#wd-horizontal-tabs ul.tabs li").width();
//jQuery("#wd-horizontal-tabs ul.tabs").css("left", -((jQuery("#wd-horizontal-tabs ul.tabs li").length - visibleCount - 1)*jQuery("#wd-horizontal-tabs ul.tabs li").width()));
}
/* HIDE SHOW ARROWS */
if (jQuery("#wd-horizontal-tabs ul.tabs").width() < jQuery("#tabs_content").width()) {
jQuery("#wd-horizontal-tabs #tabs_content").css("left", "0px");
jQuery("#tabs_left_arrow").hide();
jQuery("#tabs_right_arrow").hide();
}
else {
jQuery("#wd-horizontal-tabs #tabs_content").css("left", "16px");
jQuery("#tabs_left_arrow").show();
jQuery("#tabs_right_arrow").show();
}
jQuery("#wd-horizontal-tabs ul.content li:first-of-type").addClass("active");
jQuery("#wd-horizontal-tabs ul.tabs li:first-of-type").addClass("active");
var last_child_src = jQuery("#wd-horizontal-tabs ul.tabs li:first-of-type img").attr('src');
jQuery("#main_img img").attr('src', last_child_src);
jQuery("#wd-horizontal-tabs ul.tabs li a").click(function ()
{
jQuery("#wd-horizontal-tabs ul.tabs li").removeClass("active");
var id = jQuery(this).parent().attr("id").replace("horizontal-tab-", "");
var img_src = jQuery(this).children().attr('src');
jQuery(this).parent().addClass("active");
jQuery("#main_img img").attr('src', img_src);
jQuery("#wd-horizontal-tabs ul.content > li.active").css("display", "none").removeClass("active");
jQuery("#horizontal-tabs-content-" + id).fadeIn(600).addClass("active");
return false;
});
/* SCROLL */
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel";
jQuery('#tabs_content').on(mousewheelevt, function (e)
{
var evt = window.event || e;
evt = evt.originalEvent ? evt.originalEvent : evt;
var delta = evt.detail ? evt.detail * (-40) : evt.wheelDelta;
if (delta > 0) {
jQuery("#tabs_left_arrow").trigger('click');
}
else {
jQuery("#tabs_right_arrow").trigger('click');
}
e.preventDefault();
});
/* SWIPE */
if (typeof jQuery().swiperight !== 'undefined') {
if (jQuery.isFunction(jQuery().swiperight)) {
jQuery("#tabs_content").swiperight(function ()
{
jQuery("#tabs_left_arrow").trigger('click');
return false;
});
}
}
if (typeof jQuery().swipeleft !== 'undefined') {
if (jQuery.isFunction(jQuery().swipeleft)) {
jQuery("#tabs_content").swipeleft(function ()
{
jQuery("#tabs_right_arrow").trigger('click');
return false;
});
}
}
jQuery(window).resize(function ()
{
jQuery("#tabs_content").width(jQuery("#tabs_div").width() - 32);
//var left_right = Math.floor(jQuery("#tabs_content").width()/117);
var activel = jQuery("#wd-horizontal-tabs .tabs li.active").index() * 117;
var right_or_left = jQuery("#wd-horizontal-tabs ul.tabs").width() - jQuery("#tabs_content").width();
if (activel >= right_or_left) var active_elemo = right_or_left;
else var active_elemo = activel;
jQuery("#wd-horizontal-tabs ul.tabs").css("left", -active_elemo);
jQuery("#tabs_right_arrow, #tabs_left_arrow").removeAttr("style");
});
/* CLICK */
jQuery("#tabs_right_arrow").click(function ()
{
jQuery("#wd-horizontal-tabs ul.tabs").stop(true, false);
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left >= -(jQuery("#wd-horizontal-tabs ul.tabs").width() - jQuery("#tabs_content").width())) {
jQuery("#tabs_left_arrow").css({opacity: 1, filter: "Alpha(opacity=100)", pointerEvents: "initial"});
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left < -(jQuery("#wd-horizontal-tabs ul.tabs").width() - jQuery("#tabs_content").width() - 117)) {
jQuery("#wd-horizontal-tabs ul.tabs").animate({left: -(jQuery("#wd-horizontal-tabs ul.tabs").width() - jQuery("#tabs_content").width())}, 500, 'linear');
}
else {
jQuery("#wd-horizontal-tabs ul.tabs").animate({left: (jQuery("#wd-horizontal-tabs ul.tabs").position().left - 117)}, 500, 'linear');
}
}
window.setTimeout(function ()
{
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left == -(jQuery("#wd-horizontal-tabs ul.tabs").width() - jQuery("#tabs_content").width())) {
jQuery("#tabs_right_arrow").css({opacity: 0.3, filter: "Alpha(opacity=30)", pointerEvents: "none"});
}
}, 500);
});
jQuery("#tabs_left_arrow").click(function ()
{
jQuery("#wd-horizontal-tabs ul.tabs").stop(true, false);
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left < 0) {
jQuery("#tabs_right_arrow").css({opacity: 1, filter: "Alpha(opacity=100)", pointerEvents: "initial"});
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left > -117) {
jQuery("#wd-horizontal-tabs ul.tabs").animate({left: 0}, 500, 'linear');
}
else {
jQuery("#wd-horizontal-tabs ul.tabs").animate({left: (jQuery("#wd-horizontal-tabs ul.tabs").position().left + 117)}, 500, 'linear');
}
}
window.setTimeout(function ()
{
if (jQuery("#wd-horizontal-tabs ul.tabs").position().left == 0) {
jQuery("#tabs_left_arrow").css({opacity: 0.3, filter: "Alpha(opacity=30)", pointerEvents: "none"});
}
}, 500);
});
/*Dotted Navigation*/
if (jQuery(".dotted_navigation").length) {
var section_count = jQuery(".home_section").length;
if (section_count > 1) {
for (var i = 0; i < section_count; i++) {
jQuery(".dotted_navigation").append("");
}
jQuery(".dotted_navigation").css("margin-top", -(jQuery(".dotted_navigation").outerHeight() / 2) + "px");
}
}
jQuery(".dotted_nav_item").on("click", function ()
{
var el_index = jQuery('.dotted_nav_item').index(this);
/*jQuery(".dotted_nav_item").removeClass("active");
jQuery(this).addClass("active");*/
var home_section_pos = jQuery(".home_section").eq(el_index).offset().top;
if (jQuery("#wpadminbar").length) {
home_section_pos = home_section_pos - 32;
}
jQuery("html, body").animate({scrollTop: home_section_pos}, 500);
});
function wdwt_reset_submenus()
{
/*reset submenu openings*/
jQuery('#top-nav > div ul.sub-menu').css({left: ''});
jQuery('#top-nav > div ul.sub_shift').removeClass('sub_shift');
jQuery('#top-nav > div ul.sub_d_shift').removeClass('sub_d_shift');
}
});
jQuery(window).scroll(function ()
{
var height = jQuery(window).scrollTop();
jQuery(".home_section").each(function (index, el)
{
if (jQuery(".home_section").eq(index + 1).length) {
if (height > jQuery(el).offset().top - 50 && height < jQuery(".home_section").eq(index + 1).offset().top - 50) {
jQuery('.dotted_nav_item').eq(index).addClass("active");
}
else {
jQuery('.dotted_nav_item').eq(index).removeClass("active");
}
} else {
if (height > jQuery(el).offset().top - 50) {
jQuery('.dotted_nav_item').eq(index).addClass("active");
}
else {
jQuery('.dotted_nav_item').eq(index).removeClass("active");
}
}
});
});
// source --> http://www.sleepandgo.es/wp-content/themes/business-world/inc/js/jquery-hover-effect.js?ver=1.1.26
(function( jQuery, undefined ) {
/*
* HoverDir object.
*/
$ = jQuery;
$.HoverDir = function( options, element ) {
this.$el = $( element );
this._init( options );
};
$.HoverDir.defaults = {
hoverDelay : 0,
reverse : false
};
$.HoverDir.prototype = {
_init : function( options ) {
this.options = $.extend( true, {}, $.HoverDir.defaults, options );
// load the events
this._loadEvents();
},
_loadEvents : function() {
var _self = this;
this.$el.on( 'mouseenter.hoverdir, mouseleave.hoverdir', function( event ) {
var $el = $(this),
evType = event.type,
$hoverElem = $el.find( 'article' ),
direction = _self._getDir( $el, { x : event.pageX, y : event.pageY } ),
hoverClasses= _self._getClasses( direction );
$hoverElem.removeClass();
if( evType === 'mouseenter' ) {
$hoverElem.hide().addClass( hoverClasses.from );
clearTimeout( _self.tmhover );
_self.tmhover = setTimeout( function() {
$hoverElem.show( 0, function() {
$(this).addClass( 'da-animate' ).addClass( hoverClasses.to );
} );
}, _self.options.hoverDelay );
}
else {
$hoverElem.addClass( 'da-animate' );
clearTimeout( _self.tmhover );
$hoverElem.addClass( hoverClasses.from );
}
} );
},
// credits : http://stackoverflow.com/a/3647634
_getDir : function( $el, coordinates ) {
/** the width and height of the current div **/
var w = $el.width(),
h = $el.height(),
/** calculate the x and y to get an angle to the center of the div from that x and y. **/
/** gets the x value relative to the center of the DIV and "normalize" it **/
x = ( coordinates.x - $el.offset().left - ( w/2 )) * ( w > h ? ( h/w ) : 1 ),
y = ( coordinates.y - $el.offset().top - ( h/2 )) * ( h > w ? ( w/h ) : 1 ),
/** the angle and the direction from where the mouse came in/went out clockwise (TRBL=0123);**/
/** first calculate the angle of the point,
add 180 deg to get rid of the negative values
divide by 90 to get the quadrant
add 3 and do a modulo by 4 to shift the quadrants to a proper clockwise TRBL (top/right/bottom/left) **/
direction = Math.round( ( ( ( Math.atan2(y, x) * (180 / Math.PI) ) + 180 ) / 90 ) + 3 ) % 4;
return direction;
},
_getClasses : function( direction ) {
var fromClass, toClass;
switch( direction ) {
case 0:
// from top
( !this.options.reverse ) ? fromClass = 'da-slideFromTop' : fromClass = 'da-slideFromBottom';
toClass = 'da-slideTop';
break;
case 1:
// from right
( !this.options.reverse ) ? fromClass = 'da-slideFromRight' : fromClass = 'da-slideFromLeft';
toClass = 'da-slideLeft';
break;
case 2:
// from bottom
( !this.options.reverse ) ? fromClass = 'da-slideFromBottom' : fromClass = 'da-slideFromTop';
toClass = 'da-slideTop';
break;
case 3:
// from left
( !this.options.reverse ) ? fromClass = 'da-slideFromLeft' : fromClass = 'da-slideFromRight';
toClass = 'da-slideLeft';
break;
};
return { from : fromClass, to: toClass };
}
};
var logError = function( message ) {
if ( this.console ) {
console.error( message );
}
};
$.fn.hoverdir = function( options ) {
if ( typeof options === 'string' ) {
var args = Array.prototype.slice.call( arguments, 1 );
this.each(function() {
var instance = $.data( this, 'hoverdir' );
if ( !instance ) {
logError( "cannot call methods on hoverdir prior to initialization; " +
"attempted to call method '" + options + "'" );
return;
}
if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
logError( "no such method '" + options + "' for hoverdir instance" );
return;
}
instance[ options ].apply( instance, args );
});
}
else {
this.each(function() {
var instance = $.data( this, 'hoverdir' );
if ( !instance ) {
$.data( this, 'hoverdir', new $.HoverDir( options, this ) );
}
});
}
return this;
};
})( jQuery );
// source --> http://www.sleepandgo.es/wp-content/themes/business-world/inc/js/jquery.mobile.min.js?ver=1.1.26
/*! jQuery Mobile v1.3.2 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */
(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function T(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;di||Math.abs(n.pageY-p)>i,d&&!r&&D("vmousecancel",t,s),D("vmousemove",t,s),M()}function F(e){if(g)return;L();var t=N(e.target),n;D("vmouseup",e,t);if(!d){var r=D("vclick",e,t);r&&r.isDefaultPrevented()&&(n=x(e).changedTouches[0],v.push({touchID:E,x:n.clientX,y:n.clientY}),m=!0)}D("vmouseout",e,t),d=!1,M()}function I(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function q(){}function R(t){var n=t.substr(1);return{setup:function(r,s){I(this)||e.data(this,i,{});var o=e.data(this,i);o[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,P),e(this).bind(n,q),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",H).bind("touchend",F).bind("touchmove",j).bind("scroll",B))},teardown:function(r,s){--l[t],l[t]||b.unbind(n,P),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",H).unbind("touchmove",j).unbind("touchend",F).unbind("scroll",B));var o=e(this),u=e.data(this,i);u&&(u[t]=!1),o.unbind(n,q),I(this)||o.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var U=0;Ue.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])n.coords[0]?"swipeleft":"swiperight")},setup:function(){var t=this,n=e(t);n.bind(u,function(t){function o(t){if(!i)return;s=e.event.special.swipe.stop(t),Math.abs(i.coords[0]-s.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()}var i=e.event.special.swipe.start(t),s;n.bind(f,o).one(a,function(){n.unbind(f,o),i&&s&&e.event.special.swipe.handleSwipe(i,s),i=s=r})})}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)}}})}(e,this)});
// source --> http://www.sleepandgo.es/wp-content/themes/business-world/inc/js/jquery.mCustomScrollbar.concat.min.js?ver=1.1.26
/*mousewheel*/
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
/*custom scrollbar*/
(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("");var k=g.children(".mCSB_h_wrapper");k.wrapInner("").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("").append("")}else{l.prepend("").append("")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}y.css("display","none");q.addClass("mCS_no_scrollbar");n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(h,p,m,j,w,e,A,v){var k=c(this);if(!k.data("bindEvent_scrollbar_drag")){var n,o;if(c.support.msPointer){j.bind("MSPointerDown",function(H){H.preventDefault();k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;if(F0&&I0){n=I;o=F}});c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){H.preventDefault();if(k.data("on_drag")){var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;D(n,o,I,F)}}).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}else{j.bind("mousedown touchstart",function(H){H.preventDefault();H.stopImmediatePropagation();var G=c(this),K=G.offset(),F,J;if(H.type==="touchstart"){var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];F=I.pageX-K.left;J=I.pageY-K.top}else{k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");F=H.pageX-K.left;J=H.pageY-K.top}if(F0&&J0){n=J;o=F}}).bind("touchmove",function(H){H.preventDefault();H.stopImmediatePropagation();var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;D(n,o,I,F)});c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){if(k.data("on_drag")){var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;D(n,o,I,F)}}).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}k.data({bindEvent_scrollbar_drag:true})}function D(G,H,I,F){if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{moveDragger:true,trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&k.data("contentTouchScroll")){if(!k.data("bindEvent_content_touch")){var l,B,r,s,u,C,E;p.bind("touchstart",function(x){x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this);r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;C=s;E=u});p.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this).parent();r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",E-u,{trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",C-s,{trigger:"internal"})}})}}if(!k.data("bindEvent_scrollbar_click")){m.bind("click",function(F){var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);if(k.data("horizontalScroll")){x=(F.pageX-m.offset().left)*k.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){k.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});k.data({bindEvent_scrollbar_click:true})}if(k.data("mouseWheel")){if(!k.data("bindEvent_mousewheel")){h.bind("mousewheel",function(H,J){var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();if(k.data("normalizeMouseWheelDelta")){if(J<0){J=-1}else{J=1}}if(F==="auto"){F=100+Math.round(k.data("scrollAmount")/2)}if(k.data("horizontalScroll")){I=j.position().left;y=m.width()-j.width();x=Math.abs(p.position().left)}if((J>0&&I!==0)||(J<0&&I!==y)){H.preventDefault();H.stopImmediatePropagation()}G=x-(J*F);k.mCustomScrollbar("scrollTo",G,{trigger:"internal"})});k.data({bindEvent_mousewheel:true})}}if(k.data("scrollButtons_enable")){if(k.data("scrollButtons_scrollType")==="pixels"){if(k.data("horizontalScroll")){v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_x:false});if(!k.data("bindEvent_buttonsPixels_x")){v.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_x:true})}}else{e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_y:false});if(!k.data("bindEvent_buttonsPixels_y")){e.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))});w.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_y:true})}}function q(x){if(!j.data("preventAction")){j.data("preventAction",true);k.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(k.data("horizontalScroll")){v.add(A).unbind("click");k.data({bindEvent_buttonsPixels_x:false});if(!k.data("bindEvent_buttonsContinuous_x")){v.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollRight:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var i=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollRight"))};v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);A.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollLeft:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollLeft"))};A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);k.data({bindEvent_buttonsContinuous_x:true})}}else{e.add(w).unbind("click");k.data({bindEvent_buttonsPixels_y:false});if(!k.data("bindEvent_buttonsContinuous_y")){e.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollDown:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var t=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollDown"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);w.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollUp:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollUp"))};w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);k.data({bindEvent_buttonsContinuous_y:true})}}function z(){var x=k.data("scrollButtons_scrollSpeed");if(k.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((k.data("scrollInertia")+100)/40)}return x}}}if(k.data("autoScrollOnFocus")){if(!k.data("bindEvent_focusin")){h.bind("focusin",function(){h.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();if(k.data("horizontalScroll")){G=p.position().left;y=x.position().left;F=h.width()-x.outerWidth()}if(G+y<0||G+y>F){k.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});k.data({bindEvent_focusin:true})}}if(k.data("autoHideScrollbar")){if(!k.data("bindEvent_autoHideScrollbar")){h.bind("mouseenter",function(x){h.addClass("mCS-mouse-over");d.showScrollbar.call(h.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){h.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}});k.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write('